#include <iostream>
#include <iomanip>

using namespace std;

const int MAX_N = 10;

int main()
{
    int scale;
    cin >> scale;
    double matrix[MAX_N][MAX_N];
    double b[MAX_N];
    double x[MAX_N] = {0};

    for (int i = 0; i < scale; i++)
    {
        for (int j = 0; j < scale; j++)
        {
            cin >> matrix[i][j];
        }
    }
    for (int i = 0; i < scale; i++)
    {
        cin >> b[i];
    }

    for (int i = 0; i < scale; i++)
    {
        // 重新排列矩阵的行使得主元不是0
        int max_row = i;
        for (int j = i + 1; j < scale; j++)
        {
            if (abs(matrix[j][i]) > abs(matrix[max_row][i]))
            {
                max_row = j;
            }
        }
        swap(matrix[i], matrix[max_row]);
        swap(b[i], b[max_row]);
        // 已测试上面过程没问题

        if (matrix[i][i] == 0)
        {
            cout << "Error" << endl;
            return 0;
        }
        for (int j = i + 1; j < scale; j++)
        {
            double factor = (matrix[j][i]) / matrix[i][i];

            for (int k = i; k < scale; k++)
            {
                matrix[j][k] -= factor * matrix[i][k];
            }
            b[j] -= factor * b[i];
        }
    }

    // 开始回代解方程
    for (int i = scale - 1; i >= 0; --i)
    {
        x[i] = b[i];
        for (int j = i + 1; j < scale; ++j)
        {
            x[i] -= matrix[i][j] * x[j];
        }
        x[i] /= matrix[i][i];
    }

    for (int i = 0; i < scale; i++)
    {
        cout << fixed << setprecision(2) << x[i] << endl;
    }

    return 0;
}